using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using SalesPages.DomainModel;

namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class DynamicCombineMap : EntityTypeConfiguration<DynamicCombine>
    {
        public DynamicCombineMap()
        {
            // Primary Key
            this.HasKey(t => t.DynamicCombine_id);

            // Properties
            this.Property(t => t.MD5Template)
                .IsFixedLength()
                .HasMaxLength(32);

            this.Property(t => t.ETag)
                .HasMaxLength(100);

            this.Property(t => t.URL)
                .HasMaxLength(200);

            this.Property(t => t.MD5Phone)
                .IsFixedLength()
                .HasMaxLength(16);

            // Table & Column Mappings
            this.ToTable("DynamicCombine");
            this.Property(t => t.DynamicCombine_id).HasColumnName("DynamicCombine_id");
            this.Property(t => t.PageTemplateID).HasColumnName("PageTemplateID");
            this.Property(t => t.PhoneNumberID).HasColumnName("PhoneNumberID");
            this.Property(t => t.MD5Template).HasColumnName("MD5Template");
            this.Property(t => t.ETag).HasColumnName("ETag");
            this.Property(t => t.URL).HasColumnName("URL");
            this.Property(t => t.InsertDate).HasColumnName("InsertDate");
            this.Property(t => t.MD5Phone).HasColumnName("MD5Phone");
        }
    }
}
